<div class="translations_navigation" dir="ltr">
  <div style="float:right">
    <%= form_tag("/tr8n/admin/translation_key", :id => "tr8n_key_search_form", :method => :get) do %>
        <%=hidden_field_tag("wf_c0", "label") %>
        <%=hidden_field_tag("wf_o0", "contains") %>
        <%= text_field_tag("wf_v0_0", "", :style => "width:250px;font-size:15px;background: white url(/assets/tr8n/icn_search.png) right no-repeat; padding-right: 20px; border-radius:10px;", :placeholder => trla("Search translation keys")) %>
    <% end %>
  </div>
  <div style="font-size:22px; font-weight: bold;">
	  <%= image_tag("tr8n/tr8n_logo2.png", :style=>"width:50px;") %>  
    <%=tra("Administration Tools")%>
	</div>

  <ul class="translations_tab_nav translations_tabs">
      <% tr8n_admin_tabs.each do |tab| %>
        <%  classes = []
            current = (tab["controller"] == controller.controller_name)

            classes << "current" if current
            if tr8n_admin_tabs.first == tab
              classes << "first" 
              classes << "first_current" if current
            elsif tr8n_admin_tabs.last == tab
              classes << "last"
              classes << "last_current" if current
            end   
        %>
        
        <li class="<%=classes.join(' ') %>">
          <%=link_to(trl(tab["title"], tab["description"]), "/tr8n/admin/#{tab["controller"]}")%>
        </li>

      <% end %>
  </ul>
</div>

<div class="tr8n tr8n_admin" dir="ltr">

<script>
  function deleteObjects(id) {
    if (id) {
      if (!confirm(trl('Are you sure you want to delete this ' + Tr8n.value("type") + '?')))
         return;
       location = '/tr8n/admin/applications/delete?type=' + Tr8n.value("type") + '&ids=' + id;
       return;
    }
    
    if (!confirm(trl('Are you sure you want to delete all selected objects?')))
       return;

    Tr8n.element('tr8n_form').action = "/tr8n/admin/applications/delete";
    Tr8n.element('tr8n_form').submit();
  }

  function removeObjects(id) {
    if (id) {
      if (!confirm(trl('Are you sure you want to remove this ' + Tr8n.value("type") + ' from ' + Tr8n.value("container") + '?')))
         return;
       location = '/tr8n/admin/applications/remove?container=' + Tr8n.value("container") + '&type=' + Tr8n.value("type") + '&ids=' + id;
       return;
    }
    
    if (!confirm(trl('Are you sure you want to remove all selected objects from ' + Tr8n.value("container") + '?')))
       return;

    Tr8n.element('tr8n_form').action = "/tr8n/admin/applications/remove";
    Tr8n.element('tr8n_form').submit();
  }

</script> 
  